Skip to main content

Configuration

Every adjustable build tool behaviour is exposed as a CMake cache variable. Set them on the command line with -D, in a CMakePresets.json file, or through your IDE's CMake settings panel.

Setting a variable

cmake -S . -B build -DGPBT_LOG_VERBOSE_ENABLED=ON -DGPBT_THIRDPARTY_MODE=SOURCE

All variables prefixed with GPBT_ belong to the build tool. Do not use this prefix in your own project code — a future GPBT version may introduce a conflict.

General options

VariableTypeDefaultDescription
GPBT_IS_MONOLITHICBOOLOFFBuild all modules into a single combined library instead of individual shared objects.
GPBT_CONFIGURE_DEPENDSBOOLONRe-run CMake configure automatically when globbed source files change on disk. Disable in CI to reduce overhead.
GPBT_INSTALL_EXPORT_NAMESTRINGGPTargetsName of the CMake install export set. Change this to match your project's find_package() name.

Logging options

VariableTypeDefaultDescription
GPBT_LOG_BANNER_ENABLEDBOOLONShow the decorative section banners in the configure output.
GPBT_LOG_PREFIX_ENABLEDBOOLOFFPrepend a [GPBT] tag to every log line, useful when mixing with other CMake output.
GPBT_LOG_VERBOSE_ENABLEDBOOLOFFPrint verbose-level messages, including per-target property dumps.
GPBT_TREAT_WARNINGS_AS_FATALBOOLOFFPromote any WARNING-level log message to a fatal error. Recommended for CI.
GPBT_TREAT_ERRORS_AS_FATALBOOLOFFPromote any ERROR-level log message to a fatal error.
GPBT_DUMP_TARGETS_PROPERTIESBOOLOFFPrint all registered properties for every target after configuration. Useful when diagnosing unexpected behaviour.
tip

Enable GPBT_TREAT_WARNINGS_AS_FATAL in CI pipelines. This catches misconfigured packages or missing hashes before they reach production.

Dependency graph export

VariableTypeDefaultDescription
GPBT_EXPORT_DEPENDENCY_GRAPHBOOLOFFWrite a Graphviz DOT file of the target dependency graph at the end of configuration.
GPBT_DEPENDENCY_GRAPH_FILEFILEPATH<build>/gpbt_dependency_graph.dotPath where the DOT file is written when graph export is enabled.

See Graphviz Generation for details on rendering the output.

Testing options

VariableTypeDefaultDescription
GPBT_TESTS_ENABLEDBOOLOFFConfigure the build tool's own internal test suite instead of the example targets.
GPBT_TESTS_FILTER_SECTIONSTRING""When set, only run test sections whose name contains this substring.
GPBT_RUNNING_IN_CIBOOLOFFSignal to the build tool that it is running inside a CI environment. Enables stricter checks.

Thirdparty options

VariableTypeDefaultDescription
GPBT_THIRDPARTY_MODESTRINGAUTODefault resolution mode for all thirdparty packages. Valid values: AUTO, SOURCE, BINARY.
GPBT_THIRDPARTY_UPDATES_DISCONNECTEDBOOLONSkip network checks for already-downloaded packages, dramatically reducing reconfigure time.

Compilation options

VariableTypeDefaultDescription
GPBT_USE_LIBCXXBOOLOFFUse LLVM's libc++ instead of the system libstdc++. Recommended when using Clang on Linux.

See Third Party Management for a full explanation of these options.